home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.02 Feb 91 / 4th Debugger Appl / Calendar Debugger.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-15  |  2.1 KB  |  65 lines  |  [TEXT/KAHL]

  1. /************************************************************************/
  2. /*                                                                          */
  3. /*    Source   - CalendarDebugger.c                                        */
  4. /*    Author   - Alexander S. Colwell, Copyright © 1990                    */
  5. /*                                                                        */
  6. /*    Purpose     - This is Calendar simulator.                                */
  7. /*                                                                        */
  8. /************************************************************************/
  9.  
  10. #include "Calendar.h"                /* Calendar defs                    */
  11. #include "4th Debugger.h"            /* 4th Debugger                        */
  12.  
  13. pascal void SetCalendar(),GetCalendar();/* Define external references    */
  14. void        DoSetCalendar(),DoGetCalendar();
  15.  
  16. void C4thDbgApp::InitExtArea(void)    /* Initialized for debugging        */
  17.     {
  18.         Str255    item;                /* Working item string                */
  19.         
  20.         SetExtArea(65,25,265,127);    /* Set external rect area            */
  21.         SetExtName("\pCalendarArea");/* Set ext area name                */
  22.         
  23.         InstallExtProc(ep1,(ProcPtr)(DoSetCalendar));/* Install ext procs*/
  24.         InstallExtProc(ep2,(ProcPtr)(DoGetCalendar));
  25.         
  26.                                     /* Setup external procedure items    */
  27.         BlockMove("\pSet Calender Data",item,18L);
  28.         gBartender->SetCmdText(ep1,item);
  29.         BlockMove("\pGet Calendar Data",item,18L);
  30.         gBartender->SetCmdText(ep2,item);
  31.         
  32.         gBartender->RemoveMenuCmd(ep3);/* Remove remainding ext proc items*/
  33.         gBartender->RemoveMenuCmd(ep4);
  34.         gBartender->RemoveMenuCmd(ep5);
  35.         gBartender->RemoveMenuCmd(ep6);
  36.         gBartender->RemoveMenuCmd(ep7);
  37.         gBartender->RemoveMenuCmd(ep8);
  38.         gBartender->RemoveMenuCmd(ep9);
  39.     }
  40.  
  41. void    DoSetCalendar(CCalendar **eaObject)
  42.     {
  43.         short    itsMonth = 1;        /* Working month                    */
  44.         short    itsYear = 1990;        /* Working year                        */
  45.         long    itsSelect = 0L;        /* Working day selection            */
  46.         
  47.                                     /* Set new calendar date/selection    */
  48.         SetCalendar(eaObject,&itsMonth,&itsYear,&itsSelect);
  49.     }
  50.  
  51. void    DoGetCalendar(CCalendar **eaObject)
  52.     {
  53.         short    itsMonth;            /* Working month                    */
  54.         short    itsYear;            /* Working year                        */
  55.         long    itsSelect;            /* Working day selection            */
  56.         
  57.                                     /* Set new calendar date/selection    */
  58.         GetCalendar(eaObject,&itsMonth,&itsYear,&itsSelect);
  59.         
  60.                                     /* Output debugging information        */
  61.         DbgPrint("month - %d, year - %d, select - %lx\n",
  62.             itsMonth,itsYear,itsSelect);
  63.     }
  64.  
  65.